# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=rkward
pkgver=0.7.2
pkgrel=2
# armhf blocked by extra-cmake-modules
# s390x and ppc64le blocked by qt5-qtwebengine
# riscv64 disabled due to missing rust in recursive dependency
arch="all !armhf !s390x !ppc64le !riscv64"
url="https://rkward.kde.org/"
pkgdesc="Easy extensible and easy-to-use IDE/GUI for R"
license="GPL-2.0-or-later"
depends="R"
makedepends="
	R-dev
	extra-cmake-modules
	kconfig-dev
	kcoreaddons-dev
	kdoctools-dev
	ki18n-dev
	knotifications-dev
	kparts-dev
	ktexteditor-dev
	kwidgetsaddons-dev
	kwindowsystem-dev
	kxmlgui-dev
	qt5-qtbase-dev
	qt5-qtwebengine-dev
	samurai
	"
source="https://download.kde.org/stable/rkward/$pkgver/src/rkward-$pkgver.tar.gz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="af872b59dea8535eb6ddc0b3db56c45114fc64b0b657e5c8373eb2f7b3a63aa13f9e3c8f6050ff3eff0126df595ed30e1d1e66b91c19b7ba950838613798cb6d  rkward-0.7.2.tar.gz"
